<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">
        <title>审核列表</title>
      	<script type="text/javascript" src="./js/fontSize.js"></script>
      	<script src="./layui/layui.js" charset="utf-8"></script>
		<style>
			html{
				max-width: 750px;
			    margin: 0 auto;
			}
			body{
				font-size: 0.24rem;
				background-color: #ffffff;
				overflow-x: hidden;
              	margin: 0 auto;
			}
			.whole{
				overflow: hidden;
				margin: 0 auto;
			}
          	.index-bg{
          		width:100%;
          	}
          	.index-bg img{
                width: 100%;
            }
            .menu-list{
				/*margin:0.2rem 0;*/
              	padding:0 0.58rem;
            }
            .menu-item{
              	position:relative;
				width:100%;
              	height:2rem;
              	margin-bottom:0.8rem;
              	text-align:center;
              	line-height:2rem;
              	font-size:0.56rem;
              	color:#fff;
              	border-radius: 15px;
              	background-color: rgba(25, 171, 255, 100);
              	box-shadow: 0px 4px 4px 1px rgba(0, 0, 0, 0.4);
            }
          	.badge{
              	width:0.7rem;
              	height:0.7rem;
				top: -0.4rem;
    			right: -0.2rem;
              	position:absolute;
              	background-color:#FF0909;
              	border-radius: 50%;
              	font-size:0.4rem;
                text-align: center;
                line-height: 0.7rem;
              	border:2px solid #fff;
          	}
		</style>
    </head>
    <body>
    	<div class="whole">
            <div class="index-bg">
				<img src="./img/zhj_bg.png" />
			</div>
          	<div class="menu-list">
              	<div class="menu-item" id="zt" onclick="window.location.href='http://api.city1000.cn:9999/weixin/wechat/api/redirect?url=http://hesuan.city1000.cn/url_redirect_zht.html'">
                	<span>渣土商砼通行备案审批</span>
              	</div>
              	<div class="menu-item" id="ad" onclick="window.location.href='http://api.city1000.cn:9999/weixin/wechat/api/redirect?url=http://hesuan.city1000.cn/url_redirect.html'">
                  	<span>门店广告牌匾备案审批</span>
             	</div>
              	<div class="menu-item" id="ac" onclick="window.location.href='http://api.city1000.cn:9999/weixin/wechat/api/redirect?url=http://hesuan.city1000.cn/activity/audit/list'">
                	<span>户外活动备案审批</span>
              	</div>
          	</div>
    	</div>
      	<script>
        layui.use(['layer'], function () {
            var layer = layui.layer,
                $ = layui.$;
			
          	var code = getQueryVariable('code');
          	//alert(code);
          	if(code){
        		$.ajax({
                    url:'http://api.city1000.cn:9999/cgzf/ztad/api/remind?code='+code,
                    type:'get',
                    dataType:'json',
                    beforeSend:function(){
                        //弹出的lodinng层
                        layer.load(2,{
                            shade:[0.5,"#333"]
                        });
                    },
                    success:function(res){
                      	console.log(res);
                      	if(res.code == 0){
                          	var zt = '<div class="badge">'+res.data.zt+'</div>';
                          	if(res.data.zt > 0){
                            	$('#zt').append(zt);
                            }
                          	var ad = '<div class="badge">'+res.data.ad+'</div>';
                          	if(res.data.ad > 0){
                            	$('#ad').append(ad);
                            }
                          	var ac = '<div class="badge">'+res.data.ac+'</div>';
                          	if(res.data.ac > 0){
                            	$('#ac').append(ac);
                            }
                        }else{
                          	if(res.code == 1001){
                            	window.location.href = 'http://api.city1000.cn:9999/weixin/wechat/api/redirect?url=http://hesuan.city1000.cn/zfj_audit.html';
                            }else{
                            	layer.msg(res.msg);
                            }
                        }
                    },
                    error:function(){
                        //用户输入与接口内容不对应，显示文字
                        layer.msg("网络繁忙，访问失败")
                    },
                    complete:function(){
                        //关掉loading
                        layer.closeAll("loading")
                    }
                })
        	}else{
            	alert('参数不齐');
            }
    	});
    
		function getQueryVariable(variable)
		{
		    var query = window.location.search.substring(1);
		    var vars = query.split("&");
		    for (var i=0;i<vars.length;i++) {
		            var pair = vars[i].split("=");
		            if(pair[0] == variable){return pair[1];}
		    }
		    return(false);   
		}
	</script>
    </body>
</html>
